package com.yc.jpyy.base.redis;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import com.yc.jpyy.base.util.BissinessException;




public interface IRedisManager {
	/**
	 * 删除缓存
	 * @param key
	 * @throws BissinessException
	 */
	public void deleteKey(final String key) throws BissinessException;
	
	/**
	 * 批量删除缓存
	 * @param key
	 * @throws BissinessException
	 */
	public void deleteKey(final List<String> key) throws BissinessException;
	
	/**
	 * 写入缓存
	 * @param key
	 * @param map
	 * @throws BissinessException
	 */
	public void setKeyValue(final String key, final String value) throws BissinessException;	
	
	
	/**
	 * 批量写缓存
	 * @param key
	 * @param value
	 * @throws BissinessException
	 */
	public void setKeyValueByList(List<RedisCacheBean> list) throws BissinessException;
	
	
	/**
	 * 批量获取缓存
	 * @param list
	 * @throws BissinessException
	 */
	public void getKeyValueByList(List<RedisCacheBean> list) throws BissinessException;	
	
	public void getKeyValueByList(List<RedisCacheBean> list,IRedisCacheEmptyHelper helperHand,HashMap<String,Object> empParam) throws BissinessException;
	/**
	 * 写入缓存
	 * @param key
	 * @param map
	 * @throws BissinessException
	 */
	public void setKeyObject(final String key, final Object map) throws BissinessException;
	
	/**
	 * 获取缓存
	 * @param key
	 * @return
	 * @throws BissinessException
	 */
	public Object getKeyObject(final String key) throws BissinessException;
	
	public Object getKeyObject(final String key,IRedisCacheEmptyHelper helperHand,HashMap<String,Object> empParam) throws BissinessException;
	/**
	 * 获取缓存
	 * @param key
	 * @return
	 * @throws BissinessException
	 */
	public String getKeyValue(final String key) throws BissinessException;
	
	public String getKeyValue(final String key,IRedisCacheEmptyHelper helperHand,HashMap<String,Object> empParam) throws BissinessException;
	
	/**
	 * 设置集合
	 * @param key
	 * @param list
	 * @throws BissinessException
	 */
	public void setKeyList(final String key, final List<String> list) throws BissinessException;	
	
	/**
	 * 获取集合
	 * @param key
	 * @param inputMap 
	 * @return
	 * @throws BissinessException
	 */
	public List<String> getKeyList(final String key,IRedisCacheEmptyHelper helperHand,HashMap<String,Object> empParam)  throws BissinessException;	
	
	/**
	 * 根据key获取集合
	 * @param key
	 * @return List
	 * @throws BissinessException
	 */
	public List<String> getKeyList(final String key)  throws BissinessException;	
	
	/** 
	 * 获取redis中匹配某种规则的key值的集合
	 * 等同于命令: keys key*
	 * **/
	public Set<String> getKeys(String pattern) throws BissinessException;
	
	/** 批量获取redis中的值
	 *  @return 返回redis中的键值
	 *  **/
	public Map<String,String> getKeyValueBatch(List<String> keys) throws BissinessException;
}
